package cn.cainiao.dao;

import cn.cainiao.entity.NameInfo;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;

public class NameDao {
    public static ArrayList<NameInfo> selectAii(){
        ArrayList<NameInfo> list = new ArrayList<NameInfo>();
        ResultSet rs = null;
        Connection conn = BaseDao.getConn();
        PreparedStatement ps = null;

        try {
            String sql = "select * from comment where name=赵建鸿";
            ps = conn.prepareStatement(sql);
            rs = ps.executeQuery();
            while (rs.next()){
                NameInfo p = new NameInfo(
                        rs.getString("name"),rs.getString("sitename"),rs.getString("sitetime"),rs.getString("sitework"),rs.getString("monile"),rs.getString("qq"));
                list.add(p);
            }
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }finally {
            BaseDao.closeAll(rs,ps,conn);
        }
        return list;
    }
}
